from django.contrib import admin
from .models import Investigation, Question, Options, Grade


@admin.register(Investigation)
class InvestigationAdmin(admin.ModelAdmin):
    list_display = ['name', 'add_time']


class OptionsInline(admin.StackedInline):
    model = Options
    extra = 2


@admin.register(Question)
class QuestionAdmin(admin.ModelAdmin):
    list_display = ['invest', 'name', 'add_time']
    search_fields = ['name']
    list_filter = ['invest']

    inlines = [
        OptionsInline,
    ]
    class Media:
        # js = ('js/admin/my_own_admin.js',)
        css = {
            'all': ('css/admin/question.css',)
        }


@admin.register(Grade)
class GradeAdmin(admin.ModelAdmin):
    list_display = ['name', 'low_limit_score', 'upper_limit_score']


